package com.aspire.boc.mms.gwcmp.util;

import java.util.Random;

public class RandomCipher {

	public static char[] getChar() {
		char[] passwordLit = new char[62];
		char fword = 'A';
		char mword = 'a';
		char bword = '0';
		int totalIdx = 0;
		for(int i = 0; i< 10; i++) {
			passwordLit[totalIdx++] = bword++;
		}
		for(int i = 0; i< 26; i++) {
			passwordLit[totalIdx++] = fword++;
		}
		for(int i = 0; i< 26; i++) {
			passwordLit[totalIdx++] = mword++;
		}
		return passwordLit;
	}

	public static String result() {

		char[] r = getChar();
		Random rr = new Random();
		char[] pw = new char[5];
		StringBuffer strBuff=new StringBuffer();
		for (int i = 0; i < pw.length; i++) {
			int num = rr.nextInt(62);
			pw[i] = r[num];
			System.out.print(pw[i]);
		}
		strBuff.append(pw);
		return (strBuff.toString());
	}

}
